﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fince
{
    namespace Common
    {
        #region 对象引用交换泛型静态类
        /// <summary>
        /// 交换两个对象的引用
        /// </summary>
        /// <typeparam name="T">任意类型</typeparam>
        public static class SwapTool
        {
            /// <summary>
            /// (泛型)交换两个同类型的引用
            /// </summary>
            /// <param name="nm1">要交换的第一个对象实例</param>
            /// <param name="nm2">要交换的第二个对象实例</param>
            public static void Swap<T>(ref T nm1, ref T nm2)
            {
                T tmp = nm1;
                nm1 = nm2;
                nm2 = tmp;
            }
        }
        #endregion

    }
}
